<?php
#注册插件
RegisterPlugin("site_info","ActivePlugin_site_info");

function ActivePlugin_site_info() {}
function site_info_all_views() {
    global $zbp;
	$all_views = GetValueInArrayByCurrent($zbp->db->Query('SELECT SUM(log_ViewNums) AS num FROM ' . $GLOBALS['table']['Post']), 'num');
	return $all_views;
}
function site_info_all_artiles() {
    global $zbp;
	$all_artiles = GetValueInArrayByCurrent($zbp->db->Query('SELECT COUNT(*) AS num FROM ' . $GLOBALS['table']['Post'] . ' WHERE log_Type=\'0\''), 'num');
	return $all_artiles;
}
function site_info_all_pages() {
    global $zbp;
	$all_pages = GetValueInArrayByCurrent($zbp->db->Query('SELECT COUNT(*) AS num FROM ' . $GLOBALS['table']['Post'] . ' WHERE log_Type=\'1\''), 'num');
	return $all_pages;
}
function site_info_all_categorys() {
    global $zbp;
	$all_categorys = GetValueInArrayByCurrent($zbp->db->Query('SELECT COUNT(*) AS num FROM ' . $GLOBALS['table']['Category']), 'num');
	return $all_categorys;
}
function site_info_all_tags() {
    global $zbp;
	$all_tags = GetValueInArrayByCurrent($zbp->db->Query('SELECT COUNT(*) as num FROM ' . $GLOBALS['table']['Tag']), 'num');
	return $all_tags;
}
function site_info_all_comments() {
    global $zbp;
	$all_comments = $zbp->cache->all_comment_nums;
	return $all_comments;
}
function InstallPlugin_site_info() {}
function UninstallPlugin_site_info() {}